home *** CD-ROM | disk | FTP | other *** search
-
-
-
- TTY Devices TTY
-
-
-
- NNAAMMEE
- tty - general terminal interface
-
- SSYYNNOOPPSSIISS
- ##iinncclluuddee <<ssggttttyy..hh>>
-
- DDEESSCCRRIIPPTTIIOONN
- This section describes both a particular special file
- //ddeevv//ttttyy and the terminal drivers used for conversational
- computing. The Sprite terminal driver is substantial subset
- of the UNIX terminal driver, but there are a few features of
- the UNIX driver that aren't yet implemented in Sprite (see
- below for more details).
-
- LLiinnee ddiisscciipplliinneess..
-
- Sprite provides only a single line discipline, which behaves
- like the ``new'' line discpline in UNIX. The TIOCSETD _i_o_c_t_l
- is not implemented in Sprite.
-
- TThhee ccoonnttrrooll tteerrmmiinnaall..
-
- Sprite does not yet implement controlling terminals. The
- TIOCNOTTY _i_o_c_t_l is not implemented.
-
- PPrroocceessss ggrroouuppss..
-
- Command processors such as _c_s_h(1) can arbitrate the terminal
- between different _j_o_b_s by placing related jobs in a single
- process group and associating this process group with the
- terminal. A terminal's associated process group may be set
- using the TIOCSPGRP _i_o_c_t_l(2):
-
- iiooccttll((ffiillddeess,, TTIIOOCCSSPPGGRRPP,, &&ppggrrpp));;
-
- or examined using TIOCGPGRP, which returns the current pro-
- cess group in _p_g_r_p. The new terminal driver aids in this
- arbitration by restricting access to the terminal by
- processes which are not in the current process group; see
- JJoobb aacccceessss ccoonnttrrooll below.
-
- MMooddeess..
-
- The terminal drivers have three major modes, characterized
- by the amount of processing on the input and output charac-
- ters:
-
- cooked The normal mode. In this mode lines of input are
- collected and input editing is done. The edited
- line is made available when it is completed by a
- newline, or when the _t__b_r_k_c character (normally
- undefined) or _t__e_o_f_c character (normally an EOT,
-
-
-
- Sprite v1.0 May 19, 1986 1
-
-
-
-
-
-
- TTY Devices TTY
-
-
-
- control-D, hereafter ^D) is entered. A carriage
- return is usually made synonymous with newline in
- this mode, and replaced with a newline whenever it
- is typed. All driver functions (input editing,
- interrupt generation, output processing such as
- delay generation and tab expansion, etc.) are
- available in this mode.
-
- CBREAK This mode eliminates the character, word, and line
- editing input facilities, making the input charac-
- ter available to the user program as it is typed.
- Flow control, literal-next and interrupt process-
- ing are still done in this mode. Output process-
- ing is done.
-
- RAW This mode eliminates all input processing and
- makes all input characters available as they are
- typed; no output processing is done either.
-
- The style of input processing can also be very different
- when the terminal is put in non-blocking I/O mode; see the
- FNDELAY flag described in _f_c_n_t_l(2). In this case a _r_e_a_d(2)
- from the control terminal will never block, but rather
- return an error indication (EWOULDBLOCK) if there is no
- input available.
-
- A process may also request that a SIGIO signal be sent it
- whenever input is present and also whenever output queues
- fall below the low-water mark. To enable this mode the
- FASYNC flag should be set using _f_c_n_t_l(2).
-
- IInnppuutt eeddiittiinngg..
-
- A UNIX terminal ordinarily operates in full-duplex mode.
- Characters may be typed at any time, even while output is
- occurring, and are only lost when the system's character
- input buffers become completely choked, which is rare, or
- when the user has accumulated the maximum allowed number of
- input characters that have not yet been read by some pro-
- gram. Currently this limit is 256 characters. In RAW mode,
- the terminal driver throws away all input and output without
- notice when the limit is reached. In CBREAK or cooked mode
- it refuses to accept any further input and, if in the new
- line discipline, rings the terminal bell.
-
- Input characters are accepted in either parity (Sprite does
- no checking right now and ignores the EVEN and ODD bits of
- the flags word).
-
- It is possible to simulate terminal input using the TIOCSTI
- _i_o_c_t_l, which takes, as its third argument, the address of a
- character. The system pretends that this character was
-
-
-
- Sprite v1.0 May 19, 1986 2
-
-
-
-
-
-
- TTY Devices TTY
-
-
-
- typed on the argument terminal, which must be the control
- terminal except for the super-user (this call is not in
- standard version 7 UNIX).
-
- Input characters are normally echoed by putting them in an
- output queue as they arrive. This may be disabled by clear-
- ing the ECHO bit in the flags word using the _s_t_t_y(3C) call
- or the TIOCSETN or TIOCSETP _i_o_c_t_ls (see the SSuummmmaarryy below).
-
- In cooked mode, terminal input is processed in units of
- lines. A program attempting to read will normally be
- suspended until an entire line has been received (but see
- the description of SIGTTIN in JJoobb aacccceessss ccoonnttrrooll and of
- FIONREAD in SSuummmmaarryy, both below.) No matter how many charac-
- ters are requested in the read call, at most one line will
- be returned. It is not, however, necessary to read a whole
- line at once; any number of characters may be requested in a
- read, even one, without losing information.
-
- During input, line editing is normally done, with the erase
- character _s_g__e_r_a_s_e (by default, DELETE) logically erasing
- the last character typed and the _s_g__k_i_l_l character (default,
- ^U: control-U) logically erasing the entire current input
- line. These characters never erase beyond the beginning of
- the current input line or an eof. These characters may be
- entered literally by preceding them with `\'; the `\' will
- normally be erased when the character is typed.
-
- The drivers normally treat either a carriage return or a
- newline character as terminating an input line, replacing
- the return with a newline and echoing a return and a line
- feed. If the CRMOD bit is cleared in the local mode word
- then the processing for carriage return is disabled, and it
- is simply echoed as a return, and does not terminate cooked
- mode input.
-
- In the new driver there is a literal-next character (nor-
- mally ^V) which can be typed in both cooked and CBREAK mode
- preceding _a_n_y character to prevent its special meaning to
- the terminal handler. This is to be preferred to the use of
- `\' escaping erase and kill characters, but `\' is retained
- with its old function in the new line discipline.
-
- The new terminal driver also provides two other editing
- characters in normal mode. The word-erase character, nor-
- mally ^W, erases the preceding word, but not any spaces
- before it. For the purposes of ^W, a word is defined as a
- sequence of non-blank characters, with tabs counted as
- blanks. Finally, the reprint character, normally ^R,
- retypes the pending input beginning on a new line. Retyping
- occurs automatically in cooked mode if characters which
- would normally be erased from the screen are fouled by
-
-
-
- Sprite v1.0 May 19, 1986 3
-
-
-
-
-
-
- TTY Devices TTY
-
-
-
- program output.
-
- IInnppuutt eecchhooiinngg aanndd rreeddiissppllaayy
-
- The terminal driver has several modes (not present in stan-
- dard UNIX Version 7 systems) for handling the echoing of
- terminal input, controlled by bits in a local mode word.
-
- _H_a_r_d_c_o_p_y _t_e_r_m_i_n_a_l_s. When a hardcopy terminal is in use, the
- LPRTERA bit is normally set in the local mode word. Charac-
- ters which are logically erased are then printed out back-
- wards preceded by `\' and followed by `/' in this mode.
-
- _C_R_T _t_e_r_m_i_n_a_l_s. When a CRT terminal is in use, the LCRTBS bit
- is normally set in the local mode word. The terminal driver
- then echoes the proper number of erase characters when input
- is erased; in the normal case where the erase character is a
- ^H this causes the cursor of the terminal to back up to
- where it was before the logically erased character was
- typed. If the input has become fouled due to interspersed
- asynchronous output, the input is automatically retyped.
-
- _E_r_a_s_i_n_g _c_h_a_r_a_c_t_e_r_s _f_r_o_m _a _C_R_T. When a CRT terminal is in
- use, the LCRTERA bit may be set to cause input to be erased
- from the screen with a "backspace-space-backspace" sequence
- when character or word deleting sequences are used. A
- LCRTKIL bit may be set as well, causing the input to be
- erased in this manner on line kill sequences as well.
-
- _E_c_h_o_i_n_g _o_f _c_o_n_t_r_o_l _c_h_a_r_a_c_t_e_r_s. If the LCTLECH bit is set in
- the local state word, then non-printing (control) characters
- are normally echoed as ^X (for some X) rather than being
- echoed unmodified; delete is echoed as ^?.
-
- The normal modes for use on CRT terminals are speed depen-
- dent. At speeds less than 1200 baud, the LCRTERA and
- LCRTKILL processing is painfully slow, and _s_t_t_y(1) normally
- just sets LCRTBS and LCTLECH; at speeds of 1200 baud or
- greater all of these bits are normally set. _S_t_t_y(1) summar-
- izes these option settings and the use of the new terminal
- driver as "newcrt."
-
- OOuuttppuutt pprroocceessssiinngg..
-
- When one or more characters are written, they are actually
- transmitted to the terminal as soon as previously-written
- characters have finished typing. (As noted above, input
- characters are normally echoed by putting them in the output
- queue as they arrive.) When a process produces characters
- more rapidly than they can be typed, it will be suspended
- when its output queue exceeds some limit. When the queue
- has drained down to some threshold the program is resumed.
-
-
-
- Sprite v1.0 May 19, 1986 4
-
-
-
-
-
-
- TTY Devices TTY
-
-
-
- Even parity is normally generated on output. The EOT char-
- acter is not transmitted in cooked mode to prevent terminals
- that respond to it from hanging up; programs using RAW or
- CBREAK mode should be careful.
-
- The Sprite terminal driver does not provide any automatic
- delay generation on output; the related bits in the tty
- flags word are ignored. Sprite also does not provide
- automatic mapping between upper and lower case on terminals
- lacking lower case; we assume that such terminals have long
- since become extinct.
-
- Finally, there is a output flush character, normally ^O,
- which sets the LFLUSHO bit in the local mode word, causing
- subsequent output to be flushed until it is cleared by a
- program or more input is typed. This character has effect
- in both cooked and CBREAK modes and causes pending input to
- be retyped if there is any pending input. An _i_o_c_t_l to flush
- the characters in the input or output queues, TIOCFLUSH, is
- also available.
-
- UUppppeerr ccaassee tteerrmmiinnaallss aanndd HHaazzeellttiinneess
-
- Sprite does not support the LCASE tty flag or the LTILDE bit
- of the local mode word.
-
- FFllooww ccoonnttrrooll..
-
- There are two characters (the stop character, normally ^S,
- and the start character, normally ^Q) which cause output to
- be suspended and resumed respectively. Extra stop charac-
- ters typed when output is already stopped have no effect,
- unless the start and stop characters are made the same, in
- which case output resumes.
-
- Sprite does not support the TANDEM mode.
-
- LLiinnee ccoonnttrrooll aanndd bbrreeaakkss..
-
- There are several _i_o_c_t_l calls available to control the state
- of the terminal line. The TIOCSBRK _i_o_c_t_l will set the break
- bit in the hardware interface causing a break condition to
- exist; this can be cleared (usually after a delay with
- _s_l_e_e_p(3)) by TIOCCBRK. Break conditions in the input are
- reflected as a null character in RAW mode or as the inter-
- rupt character in cooked or CBREAK mode. The TIOCCDTR _i_o_c_t_l
- will clear the data terminal ready condition; it can be set
- again by TIOCSDTR.
-
- When the carrier signal from the dataset drops (usually
- because the user has hung up his terminal) a SIGHUP hangup
- signal is sent to the processes in the distinguished process
-
-
-
- Sprite v1.0 May 19, 1986 5
-
-
-
-
-
-
- TTY Devices TTY
-
-
-
- group of the terminal; this usually causes them to ter-
- minate. The SIGHUP can be suppressed by setting the LNOHANG
- bit in the local state word of the driver. Access to the
- terminal by other processes is then normally revoked, so any
- further reads will fail, and programs that read a terminal
- and test for end-of-file on their input will terminate
- appropriately. Note: Sprite provides only partial support
- for modems at present.
-
- It is possible to ask that the phone line be hung up on the
- last close with the TIOCHPCL _i_o_c_t_l; this is normally done on
- the outgoing lines and dialups.
-
- IInntteerrrruupptt cchhaarraacctteerrss..
-
- There are several characters that generate interrupts in
- cooked and CBREAK mode; all are sent to the processes in the
- control group of the terminal, as if a TIOCGPGRP _i_o_c_t_l were
- done to get the process group and then a _k_i_l_l_p_g(2) system
- call were done, except that these characters also flush
- pending input and output when typed at a terminal ('_a`'_l_a
- TIOCFLUSH). The characters shown here are the defaults; the
- field names in the structures (given below) are also shown.
- The characters may be changed.
-
- ^C tt__iinnttrrcc (ETX) generates a SIGINT signal. This is the
- normal way to stop a process which is no longer
- interesting, or to regain control in an interactive
- program.
-
- ^\ tt__qquuiittcc (FS) generates a SIGQUIT signal. This is used
- to cause a program to terminate and produce a core
- image, if possible, in the file ccoorree in the current
- directory.
-
- ^Z tt__ssuussppcc (EM) generates a SIGTSTP signal, which is used
- to suspend the current process group.
-
- ^Y tt__ddssuussppcc (SUB) generates a SIGTSTP signal as ^Z does,
- but the signal is sent when a program attempts to read
- the ^Y, rather than when it is typed.
-
- JJoobb aacccceessss ccoonnttrrooll..
-
- When using the new terminal driver, if a process which is
- not in the distinguished process group of its control termi-
- nal attempts to read from that terminal its process group is
- sent a SIGTTIN signal. This signal normally causes the
- members of that process group to stop. If, however, the pro-
- cess is ignoring SIGTTIN, has SIGTTIN blocked, or is in the
- middle of process creation using _v_f_o_r_k(2)), the read will
- return -1 and set _e_r_r_n_o to EIO.
-
-
-
- Sprite v1.0 May 19, 1986 6
-
-
-
-
-
-
- TTY Devices TTY
-
-
-
- When using the new terminal driver with the LTOSTOP bit set
- in the local modes, a process is prohibited from writing on
- its control terminal if it is not in the distinguished pro-
- cess group for that terminal. Processes which are holding
- or ignoring SIGTTOU signals or which are in the middle of a
- _v_f_o_r_k(2) are excepted and allowed to produce output.
- TTeerrmmiinnaall//wwiinnddooww ssiizzeess.. In order to accommodate terminals and
- workstations with variable-sized windows, the terminal
- driver provides a mechanism for obtaining and setting the
- current terminal size. The driver does not use this infor-
- mation internally, but only stores it and provides a uniform
- access mechanism. When the size is changed, a SIGWINCH sig-
- nal is sent to the terminal's process group so that
- knowledgeable programs may detect size changes. This facil-
- ity was added in 4.3BSD and is not available in earlier ver-
- sions of the system.
-
- SSuummmmaarryy ooff mmooddeess..
-
- Unfortunately, due to the evolution of the terminal driver,
- there are 4 different structures which contain various por-
- tions of the driver data. The first of these (ssggttttyybb) con-
- tains that part of the information largely common between
- version 6 and version 7 UNIX systems. The second contains
- additional control characters added in version 7. The third
- is a word of local state added in 4BSD, and the fourth is
- another structure of special characters added for the new
- driver. In the future a single structure may be made avail-
- able to programs which need to access all this information;
- most programs need not concern themselves with all this
- state.
-
- _B_a_s_i_c _m_o_d_e_s: _s_g_t_t_y.
-
- The basic _i_o_c_t_ls use the structure defined in <_s_g_t_t_y._h>:
-
- ssttrruucctt ssggttttyybb {{
- cchhaarr ssgg__iissppeeeedd;;
- cchhaarr ssgg__oossppeeeedd;;
- cchhaarr ssgg__eerraassee;;
- cchhaarr ssgg__kkiillll;;
- sshhoorrttssgg__ffllaaggss;;
- }};;
-
- The _s_g__i_s_p_e_e_d and _s_g__o_s_p_e_e_d fields describe the input and
- output speeds of the device according to the following
- table, which corresponds to the DEC DH-11 interface. If
- other hardware is used, impossible speed changes are
- ignored. Symbolic values in the table are as defined in
- <_s_g_t_t_y._h>.
-
- B0 0 (hang up dataphone)
-
-
-
- Sprite v1.0 May 19, 1986 7
-
-
-
-
-
-
- TTY Devices TTY
-
-
-
- B50 1 50 baud
- B75 2 75 baud
- B110 3 110 baud
- B134 4 134.5 baud
- B150 5 150 baud
- B200 6 200 baud
- B300 7 300 baud
- B600 8 600 baud
- B1200 9 1200 baud
- B1800 10 1800 baud
- B2400 11 2400 baud
- B4800 12 4800 baud
- B9600 13 9600 baud
- EXTA 14 External A
- EXTB 15 External B
-
- Code conversion and line control required for IBM 2741's
- (134.5 baud) must be implemented by the user's program. The
- half-duplex line discipline required for the 202 dataset
- (1200 baud) is not supplied; full-duplex 212 datasets work
- fine.
-
- The _s_g__e_r_a_s_e and _s_g__k_i_l_l fields of the argument structure
- specify the erase and kill characters respectively.
- (Defaults are DELETE and ^U.)
-
- The _s_g__f_l_a_g_s field of the argument structure contains
- several bits that determine the system's treatment of the
- terminal:
-
- ALLDELAY 0177400 Delay algorithm selection
- BSDELAY 0100000 Select backspace delays (not implemented):
- BS0 0
- BS1 0100000
- VTDELAY 0040000 Select form-feed and vertical-tab delays (not supported in Sprite):
- FF0 0
- FF1 0040000
- CRDELAY 0030000 Select carriage-return delays (not supported in Sprite):
- CR0 0
- CR1 0010000
- CR2 0020000
- CR3 0030000
- TBDELAY 0006000 Select tab delays (not supported in Sprite):
- TAB0 0
- TAB1 0002000
- TAB2 0004000
- XTABS 0006000
- NLDELAY 0001400 Select new-line delays (not supported in Sprite):
- NL0 0
- NL1 0000400
- NL2 0001000
- NL3 0001400
-
-
-
- Sprite v1.0 May 19, 1986 8
-
-
-
-
-
-
- TTY Devices TTY
-
-
-
- EVENP 0000200 Even parity allowed on input (ignored in Sprite)
- ODDP 0000100 Odd parity allowed on input (ignored in Sprite)
- RAW 0000040 Raw mode: wake up on all characters, 8-bit interface
- CRMOD 0000020 Map CR into LF; output LF as CR-LF
- ECHO 0000010 Echo (full duplex)
- LCASE 0000004 Map upper case to lower on input and lower to upper on output
- CBREAK 0000002 Return each character as soon as typed
- TANDEM 0000001 Automatic flow control (not supported in Sprite)
-
- At present, Sprite does not generate any output delays, nor
- does it generate or check parity.
-
- RAW disables all processing save output flushing with
- LFLUSHO; full 8 bits of input are given as soon as it is
- available; all 8 bits are passed on output. A break condi-
- tion in the input is reported as a null character. If the
- input queue overflows in raw mode all data in the input and
- output queues are discarded; this applies to both new and
- old drivers.
-
- CRMOD causes input carriage returns to be turned into new-
- lines, and output and echoed new-lines to be output as a
- carriage return followed by a line feed.
-
- CBREAK is a sort of half-cooked (rare?) mode. Programs can
- read each character as soon as typed, instead of waiting for
- a full line; all processing is done except the input edit-
- ing: character and word erase and line kill, input reprint,
- and the special treatment of \ and EOT are disabled.
-
- TANDEM mode is not supported in Sprite.
-
- NNoottee:: The same ``stop'' and ``start'' characters are used
- for both directions of flow control; the _t__s_t_o_p_c character
- is accepted on input as the character that stops output and
- is produced on output as the character to stop input, and
- the _t__s_t_a_r_t_c character is accepted on input as the character
- that restarts output and is produced on output as the char-
- acter to restart input.
-
- _B_a_s_i_c _i_o_c_t_l_s
-
- A large number of _i_o_c_t_l(2) calls apply to terminals. Some
- have the general form:
-
- ##iinncclluuddee <<ssggttttyy..hh>>
-
- iiooccttll((ffiillddeess,, ccooddee,, aarrgg))
- ssttrruucctt ssggttttyybb **aarrgg;;
-
- The applicable codes are:
-
-
-
-
- Sprite v1.0 May 19, 1986 9
-
-
-
-
-
-
- TTY Devices TTY
-
-
-
- TIOCGETP Fetch the basic parameters associated with
- the terminal, and store in the pointed-to
- _s_g_t_t_y_b structure.
-
- TIOCSETP Set the parameters according to the pointed-
- to _s_g_t_t_y_b structure. The interface delays
- until output is quiescent, then throws away
- any unread characters, before changing the
- modes.
-
- TIOCSETN Set the parameters like TIOCSETP but do not
- delay or flush input. Input is not
- preserved, however, when changing to or from
- RAW.
-
- With the following codes _a_r_g is ignored.
-
- TIOCEXCL Set "exclusive-use" mode: no further opens
- are permitted until the file has been closed.
-
- TIOCNXCL Turn off "exclusive-use" mode.
-
- TIOCHPCL When the file is closed for the last time,
- hang up the terminal. This is useful when
- the line is associated with an ACU used to
- place outgoing calls.
-
- With the following codes _a_r_g is a pointer to an iinntt.
-
- TIOCGETD _a_r_g is a pointer to an iinntt into which is
- placed the current line discipline number.
-
- TIOCSETD _a_r_g is a pointer to an iinntt whose value
- becomes the current line discipline number.
-
- TIOCFLUSH If the iinntt pointed to by _a_r_g has a zero
- value, all characters waiting in input or
- output queues are flushed. Otherwise, the
- value of the iinntt is for the FREAD and FWRITE
- bits defined in <<ssyyss//ffiillee..hh>>; if the FREAD
- bit is set, all characters waiting in input
- queues are flushed, and if the FWRITE bit is
- set, all characters waiting in output queues
- are flushed.
-
- The remaining calls are not available in vanilla version 7
- UNIX. In cases where arguments are required, they are
- described; _a_r_g should otherwise be given as 0.
-
- TIOCSTI the argument points to a character which the
- system pretends had been typed on the termi-
- nal.
-
-
-
- Sprite v1.0 May 19, 1986 10
-
-
-
-
-
-
- TTY Devices TTY
-
-
-
- TIOCSBRK the break bit is set in the terminal.
-
- TIOCCBRK the break bit is cleared.
-
- TIOCSDTR data terminal ready is set.
-
- TIOCCDTR data terminal ready is cleared.
-
- TIOCSTOP output is stopped as if the ``stop'' charac-
- ter had been typed.
-
- TIOCSTART output is restarted as if the ``start'' char-
- acter had been typed.
-
- TIOCGPGRP _a_r_g is a pointer to an iinntt into which is
- placed the process group ID of the process
- group for which this terminal is the control
- terminal.
-
- TIOCSPGRP _a_r_g is a pointer to an iinntt which is the value
- to which the process group ID for this termi-
- nal will be set.
-
- TIOCOUTQ not supported in Sprite.
-
- FIONREAD returns in the iinntt pointed to by _a_r_g the
- number of characters immediately readable
- from the argument descriptor. This works for
- files, pipes, and terminals.
-
- _T_c_h_a_r_s
-
- The second structure associated with each terminal specifies
- characters that are special in both the old and new terminal
- interfaces: The following structure is defined in
- <_s_y_s/_i_o_c_t_l._h>, which is automatically included in <_s_g_t_t_y._h>:
-
- ssttrruucctt ttcchhaarrss {{
- cchhaarr tt__iinnttrrcc;; //** iinntteerrrruupptt **//
- cchhaarr tt__qquuiittcc;; //** qquuiitt **//
- cchhaarr tt__ssttaarrttcc;; //** ssttaarrtt oouuttppuutt **//
- cchhaarr tt__ssttooppcc;; //** ssttoopp oouuttppuutt **//
- cchhaarr tt__eeooffcc;; //** eenndd--ooff--ffiillee **//
- cchhaarr tt__bbrrkkcc;; //** iinnppuutt ddeelliimmiitteerr ((lliikkee nnll)) **//
- }};;
-
- The default values for these characters are ^C, ^\, ^Q, ^S,
- ^D, and -1. A character value of -1 eliminates the effect
- of that character. The _t__b_r_k_c character, by default -1,
- acts like a new-line in that it terminates a `line,' is
- echoed, and is passed to the program. The `stop' and
- `start' characters may be the same, to produce a toggle
-
-
-
- Sprite v1.0 May 19, 1986 11
-
-
-
-
-
-
- TTY Devices TTY
-
-
-
- effect. It is probably counterproductive to make other spe-
- cial characters (including erase and kill) identical. The
- applicable _i_o_c_t_l calls are:
-
- TIOCGETC Get the special characters and put them in the
- specified structure.
-
- TIOCSETC Set the special characters to those given in the
- structure.
-
- _L_o_c_a_l _m_o_d_e
-
- The third structure associated with each terminal is a local
- mode word. The bits of the local mode word are:
-
- LCRTBS 000001 Backspace on erase rather than echoing erase
- LPRTERA 000002 Printing terminal erase mode
- LCRTERA 000004 Erase character echoes as backspace-space-backspace
- LTILDE 000010 Convert ~ to ` on output (not supported in Sprite)
- LMDMBUF 000020 Stop/start output when carrier drops (not supported in Sprite)
- LLITOUT 000040 Suppress output translations
- LTOSTOP 000100 Send SIGTTOU for background output (not supported in Sprite)
- LFLUSHO 000200 Output is being flushed
- LNOHANG 000400 Don't send hangup when carrier drops (not supported in Sprite)
- LETXACK 001000 Diablo style buffer hacking (unimplemented)
- LCRTKIL 002000 BS-space-BS erase entire line on line kill
- LPASS8 004000 Pass all 8 bits through on input, in any mode (not supported in Sprite)
- LCTLECH 010000 Echo input control chars as ^X, delete as ^?
- LPENDIN 020000 Retype pending input at next read or input character
- LDECCTQ 040000 Only ^Q restarts output after ^S, like DEC systems (not supported in Sprite)
- LNOFLSH 100000 Inhibit flushing of pending I/O when an interrupt character is typed (not supported in Sprite)
-
- The applicable _i_o_c_t_l functions are:
-
- TIOCLBIS _a_r_g is a pointer to an iinntt whose value is a
- mask containing the bits to be set in the
- local mode word.
-
- TIOCLBIC _a_r_g is a pointer to an iinntt whose value is a
- mask containing the bits to be cleared in the
- local mode word.
-
- TIOCLSET _a_r_g is a pointer to an iinntt whose value is
- stored in the local mode word.
-
- TIOCLGET _a_r_g is a pointer to an iinntt into which the
- current local mode word is placed.
-
- _L_o_c_a_l _s_p_e_c_i_a_l _c_h_a_r_s
-
- The final control structure associated with each terminal is
- the _l_t_c_h_a_r_s structure which defines control characters for
-
-
-
- Sprite v1.0 May 19, 1986 12
-
-
-
-
-
-
- TTY Devices TTY
-
-
-
- the new terminal driver. Its structure is:
-
- ssttrruucctt llttcchhaarrss {{
- cchhaarr tt__ssuussppcc;; //** ssttoopp pprroocceessss ssiiggnnaall **//
- cchhaarr tt__ddssuussppcc;; //** ddeellaayyeedd ssttoopp pprroocceessss ssiiggnnaall **//
- cchhaarr tt__rrpprrnnttcc;; //** rreepprriinntt lliinnee **//
- cchhaarr tt__fflluusshhcc;; //** fflluusshh oouuttppuutt ((ttoogggglleess)) **//
- cchhaarr tt__wweerraasscc;; //** wwoorrdd eerraassee **//
- cchhaarr tt__llnneexxttcc;; //** lliitteerraall nneexxtt cchhaarraacctteerr **//
- }};;
-
- The default values for these characters are ^Z, ^Y, ^R, ^O,
- ^W, and ^V. A value of -1 disables the character.
-
- The applicable _i_o_c_t_l functions are:
-
- TIOCSLTC _a_r_g is a pointer to an _l_t_c_h_a_r_s structure which
- defines the new local special characters.
-
- TIOCGLTC _a_r_g is a pointer to an _l_t_c_h_a_r_s structure into
- which is placed the current set of local special
- characters.
-
- _W_i_n_d_o_w/_t_e_r_m_i_n_a_l _s_i_z_e_s
-
- Each terminal has provision for storage of the current ter-
- minal or window size in a _w_i_n_s_i_z_e structure, with format:
-
- ssttrruucctt wwiinnssiizzee {{
- uunnssiiggnneedd sshhoorrtt wwss__rrooww;; //** rroowwss,, iinn cchhaarraacctteerrss **//
- uunnssiiggnneedd sshhoorrtt wwss__ccooll;; //** ccoolluummnnss,, iinn cchhaarraacctteerrss **//
- uunnssiiggnneedd sshhoorrtt wwss__xxppiixxeell;; //** hhoorriizzoonnttaall ssiizzee,, ppiixxeellss **//
- uunnssiiggnneedd sshhoorrtt wwss__yyppiixxeell;; //** vveerrttiiccaall ssiizzee,, ppiixxeellss **//
- }};;
-
- A value of 0 in any field is interpreted as ``undefined;''
- the entire structure is zeroed on final close.
-
- The applicable _i_o_c_t_l functions are:
-
- TIOCGWINSZ
- _a_r_g is a pointer to a ssttrruucctt wwiinnssiizzee into which will be
- placed the current terminal or window size information.
-
- TIOCSWINSZ
- _a_r_g is a pointer to a ssttrruucctt wwiinnssiizzee which will be used
- to set the current terminal or window size information.
- If the new information is different than the old infor-
- mation, a SIGWINCH signal will be sent to the
- terminal's process group.
-
-
-
-
-
- Sprite v1.0 May 19, 1986 13
-
-
-
-
-
-
- TTY Devices TTY
-
-
-
- FFIILLEESS
- /dev/tty
- /dev/tty*
- /dev/console
-
- SSEEEE AALLSSOO
- csh(1), stty(1), tset(1), ioctl(2), sigvec(2), stty(3C),
- getty(8)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Sprite v1.0 May 19, 1986 14
-
-
-
-